#include "stdafx.h"
#ifndef MagicCubeGame_H
enum GamePattern
{
	HANDEL=0,
	RANDOM=1
};

class MagicCubeGame
{
public:
	MagicCubeGame(void);
	void Render(void);
	void RotateWorld(GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
	void AddOperation(MagicCubeOperation* operation);
	void SetGamePattern(GamePattern pattern);
	void SetMagicPosition(GLfloat x,GLfloat y,GLfloat z);
	void AddDrawObject(DrawFuncInfo* info);
	void Reset();
	void StepUndo();
	void StepsUndo();
	bool CheckMovingStatus();
	~MagicCubeGame(void);
private:
	void DrawXYZ();
	void RandomOperation();
	void HandelOperation();
	MagicCubeOperation* GetRandomOperation();
private:
	std::queue<MagicCubeOperation*>		*operationList;
	std::stack<MagicCubeOperation*>		*operationHistory;
	std::list<DrawFuncInfo*>             *functions;
	MagicCube							*magic;
	CCriticalSection					*lock;
	GamePattern							gamePattern;
	static const int MAXCOUNT			=10;
	bool isStopRandom;
	bool isMoving;
	
};
#define MagicCubeGame_H
#endif


